package com.xiaotu.yapi.common;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 分类名称
 * 分类备注/描述
 *
 * @author Mr.zhang
 * @module yapi
 * @date 2022-01-12 19:53
 */
@ConfigurationProperties(prefix = "template")
@Data
@Component
public class TemplateConfig {


    private String prefix;

    private String abc;

    private TemplateConfig(Environment ev){
        prefix = ev.getProperty("user.dir") + "\\" + ev.getProperty("spring.application.name") + "\\";
    }

    @PostConstruct
    public void init() {
        abc = prefix + abc;
    }


}
